package com.wbsxch.hello.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class HelloController {

    @GetMapping({"/","/index","hello"})
    public String hello(@RequestParam(name = "info",required = false)String info){
        if(info != null){
            return info;
        }
        return "Hello Docker";
    }

    @GetMapping("/hehe")
    public String hehe(@RequestParam(name = "info",required = false) String info){
        return "呵呵,"+info+" !";
    }

    @GetMapping("/haha")
    public Map<String,Object> haha(){
        Map<String,Object> map = new HashMap();
        map.put("name","小明");
        map.put("age",16);
        map.put("address","杭州");//dddd
        return map;
    }

}
